Use DEFINE_SPINLOCK in Linux drivers, conforming to coding style.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 24 May 2006 10:56:40 +0000 (11:56 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 24 May 2006 10:56:40 +0000 (11:56 +0100)
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c
linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c
linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c
linux-2.6-xen-sparse/drivers/xen/blktap/blktap.c
linux-2.6-xen-sparse/drivers/xen/console/console.c
linux-2.6-xen-sparse/drivers/xen/core/evtchn.c
linux-2.6-xen-sparse/drivers/xen/core/gnttab.c
linux-2.6-xen-sparse/drivers/xen/netback/netback.c

index a0ea8d11603858b88eabeed00ba1479d08026cef..b4ef5c1646b270d1d64846e73f03394be657d52f 100644 (file)
@@ -67,7 +67,7 @@ static DECLARE_MUTEX(balloon_mutex);
  * Also protects non-atomic updates of current_pages and driver_pages, and
  * balloon lists.
  */
-spinlock_t balloon_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(balloon_lock);
 
 /* We aim for 'current allocation' == 'target allocation'. */
 static unsigned long current_pages;
index 39daafe43cb57284af23f553cc1ad16b9a6cd110..cffb114f0d5008bf6fb04115a168051b3f70b601 100644 (file)
@@ -82,7 +82,7 @@ typedef struct {
 
 static pending_req_t *pending_reqs;
 static struct list_head pending_free;
-static spinlock_t pending_free_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(pending_free_lock);
 static DECLARE_WAIT_QUEUE_HEAD(pending_free_wq);
 
 #define BLKBACK_INVALID_HANDLE (~0)
index 81d9c7fb8c84dc45e96b6a2ec7ee5c09fc54b192..efa396142ad19b18a128eb2501c1d0b565fab895 100644 (file)
@@ -93,7 +93,7 @@ static struct block_device_operations xlvbd_block_fops =
        .ioctl  = blkif_ioctl,
 };
 
-spinlock_t blkif_io_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(blkif_io_lock);
 
 static struct xlbd_major_info *
 xlbd_alloc_major_info(int major, int minor, int index)
index 6c93292e30b97dc2b4440e7141a1c5baa5b4f2fc..a414e5067288ba4f097d6ad1ef4324b3e0961fd7 100644 (file)
@@ -138,7 +138,7 @@ typedef struct {
  */
 static pending_req_t pending_reqs[MAX_PENDING_REQS];
 static unsigned char pending_ring[MAX_PENDING_REQS];
-static spinlock_t pend_prod_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(pend_prod_lock);
 /* NB. We use a different index type to differentiate from shared blk rings. */
 typedef unsigned int PEND_RING_IDX;
 #define MASK_PEND_IDX(_i) ((_i)&(MAX_PENDING_REQS-1))
index de0a1e345797d1a1ba6ac06149788ec22b8b6219..9a2eaefdbfdbc2f029db3d7fe91049f6a2fe37e5 100644 (file)
@@ -124,7 +124,7 @@ static int __init xencons_bufsz_setup(char *str)
 __setup("xencons_bufsz=", xencons_bufsz_setup);
 
 /* This lock protects accesses to the common transmit buffer. */
-static spinlock_t xencons_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(xencons_lock);
 
 /* Common transmit-kick routine. */
 static void __xencons_tx_flush(void);
index 5632511d2b57d27c7725e8d1e05e7dbf3f522ec7..5ab7e26b8ef94e2f194645d4bbd9a0fa6c62d683 100644 (file)
@@ -51,7 +51,7 @@
  * This lock protects updates to the following mapping and reference-count
  * arrays. The lock does not need to be acquired to read the mapping tables.
  */
-static spinlock_t irq_mapping_update_lock;
+static DEFINE_SPINLOCK(irq_mapping_update_lock);
 
 /* IRQ <-> event-channel mappings. */
 static int evtchn_to_irq[NR_EVENT_CHANNELS];
@@ -815,8 +815,6 @@ void __init xen_init_IRQ(void)
        int i;
        int cpu;
 
-       spin_lock_init(&irq_mapping_update_lock);
-
        init_evtchn_cpu_bindings();
 
        /* No VIRQ or IPI bindings. */
index 0b288e61b2e982d14ffce5e5966d9660f706801a..2bab3f27be16faa99781ebeee3b90f885991c3a2 100644 (file)
@@ -81,7 +81,7 @@ EXPORT_SYMBOL_GPL(gnttab_grant_foreign_transfer_ref);
 static grant_ref_t gnttab_list[NR_GRANT_ENTRIES];
 static int gnttab_free_count;
 static grant_ref_t gnttab_free_head;
-static spinlock_t gnttab_list_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(gnttab_list_lock);
 
 static grant_entry_t *shared = NULL;
 
index a6f5080bfd26ae690f9733f4ebfeebc131e4fcb2..fb6b88e5e2ccaed5c529a94f7bacc28eb03ad1d1 100644 (file)
@@ -99,7 +99,7 @@ static spinlock_t net_schedule_list_lock;
 #define MAX_MFN_ALLOC 64
 static unsigned long mfn_list[MAX_MFN_ALLOC];
 static unsigned int alloc_index = 0;
-static spinlock_t mfn_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(mfn_lock);
 
 static unsigned long alloc_mfn(void)
 {
@@ -691,7 +691,7 @@ static void net_tx_action(unsigned long unused)
 
 static void netif_idx_release(u16 pending_idx)
 {
-       static spinlock_t _lock = SPIN_LOCK_UNLOCKED;
+       static DEFINE_SPINLOCK(_lock);
        unsigned long flags;
 
        spin_lock_irqsave(&_lock, flags);